package Server;
import java.rmi.Naming;
import java.net.InetAddress;
public class GameServer {
	   public static void main(String[] args) {

		      String serviceName = "RemoteCarGameService";
		      if (args.length > 0){ serviceName = args[0]; }
		      try { 
		         InetAddress addr = InetAddress.getLocalHost();
		         String hostname = addr.getHostName();  

		         GameServant gs = new GameServant();
		         Naming.rebind("rmi://"+hostname+"/"+ serviceName, gs); 
		         System.out.println(serviceName + " is running..");
		    
		      } catch(Exception ex) {
		         System.out.println("Error starting the server: "  + 
				      ex.getMessage());
		      }
	   }
}
